package com.example.Laboratory.Service.Impl;

import com.example.Laboratory.Entity.Company;
import com.example.Laboratory.Mapper.CompanyMapper;
import com.example.Laboratory.Service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CompanyServiceImpl implements CompanyService {

    @Autowired
    CompanyMapper companyMapper;

    //增加校企合作
    @Override
    public String addCompany(Company t) {
        if (companyMapper.addCompany(t) == 1) {
            return "添加成功";
        } else {
            return "添加失败";
        }
    }

    //查找校企合作
    @Override
    public List<Company> selectCompany() {
        return companyMapper.selectCompany();
    }

    //删除校企合作
    @Override
    public String deleteCompany(int company_id) {
        if (companyMapper.deleteCompany(company_id) == 1) {
            return "删除成功";
        } else {
            return "删除失败";
        }
    }

    //修改校企合作
    @Override
    public String updateCompany(Company i) {
        if (companyMapper.updateCompany(i) == 1) {
            return "修改成功";
        } else {
            return "修改失败";
        }
    }

}
